package com.ucode.springboot.starter.ESsearch.repository.query;

/**
 * 高级查询增强功能
 * @author: liliang
 * @date: 2020年1月7日 下午3:33:09
 */
public class Advanc{
    /**
     * 分页+排序+高亮
     */
    private PageSortHighLight pageSortHighLight = null;
    /**
     * 指定返回字段
     */
    private String[] includes;
    /**
     * 排除返回字段
     */
    private String[] excludes;
    /**
     * 路由
     */
    private String routing;
    /**
     * 主要解决了elasticsearch深分页（deep paging）的问题，但只能从第一页一页一页向后翻
     * https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-search-after
     * search after不可指定from
     * search after可指定检索后排序
     */
    private boolean searchAfter = false;
    /**
     * 排序内容
     */
    private Object[] sortValues;

    public String[] getIncludes() {
        return includes;
    }

    public void setIncludes(String[] includes) {
        this.includes = includes;
    }

    public String[] getExcludes() {
        return excludes;
    }

    public void setExcludes(String[] excludes) {
        this.excludes = excludes;
    }

    public PageSortHighLight getPageSortHighLight() {
        return pageSortHighLight;
    }

    public void setPageSortHighLight(PageSortHighLight pageSortHighLight) {
        this.pageSortHighLight = pageSortHighLight;
    }

    public String getRouting() {
        return routing;
    }

    public void setRouting(String routing) {
        this.routing = routing;
    }

    public boolean isSearchAfter() {
        return searchAfter;
    }

    public void setSearchAfter(boolean searchAfter) {
        this.searchAfter = searchAfter;
    }

    public Object[] getSortValues() {
        return sortValues;
    }

    public void setSortValues(Object[] sortValues) {
        this.sortValues = sortValues;
    }
}